# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=nanomsg
pkgver=1.2.1
pkgrel=0
pkgdesc="Socket library that provides several common communication patterns"
url="https://nanomsg.org"
arch="all !armhf !armv7"  # armhf: segfaults in 2 tests
license="MIT"
makedepends="
	asciidoctor
	cmake
	samurai
	xmlto
	"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/nanomsg/nanomsg/archive/$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
cc119acafe6e000b75299e866b4bace56ec6d8c90e7843ad773efad7b534296d6baf2b75b107c70a0e4fd4cee9763315d87b6f354676b7915732961b89c3adcb  nanomsg-1.2.1.tar.gz
"
